/* Layout */
import Layout from '@/layout'

/* 静态路由 */
export const constantRoutes = [
    {
        path: '/login',
        name: "Login",
        component: () => import('@/views/login/index'),
        hidden: true
    },

    {
        path: '/404',
        name: "404",
        component: () => import('@/views/error/index'),
        hidden: true
    },

    {
        path: '/',
        component: Layout,
        redirect: '/home',
        children: [{
            path: 'home',
            name: 'Home',
            component: () => import('@/views/home/index'),
            meta: { title: '首页', icon: 'el-icon-s-home' }
        }]
    },

]

/* 动态路由 */
export const allAsyncRoutes = [
    {
        path: '/acl',
        component: Layout,
        redirect: '/acl/user',
        name: 'Acl',
        meta: {
            title: '权限管理', icon: 'el-icon-s-tools'
        },
        children: [
            {
                path: '/acl/user',
                name: 'User',
                component: () => import('@/views/acl/user'),
                meta: {
                    title: '用户管理',
                }
            },
            {
                path: '/acl/role',
                name: 'Role',
                component: () => import('@/views/acl/role'),
                meta: {
                    title: '角色管理',
                }
            },
            {
                path: "/acl/roleAuth",
                name: "RoleAuth",
                component: () => import("@/views/acl/role/roleAuth.vue"),
                hidden: true,
                meta: {
                    title: "角色管理"
                }
            },
            {
                path: '/acl/permission',
                name: 'Permission',
                component: () => import('@/views/acl/permission'),
                meta: {
                    title: '菜单管理',
                }
            },
        ]
    },

    {
        path: '/product',
        component: Layout,
        redirect: '/product/trademark',
        name: 'Product',
        meta: {
            title: '商品管理',
            icon: 'el-icon-s-goods'
        },
        children: [
            {
                path: "/product/trademark",
                name: "Trademark",
                component: () => import("@/views/product/trademark"),
                meta: {
                    title: "品牌管理",
                }
            },
            {
                path: "/product/attr",
                name: "Attr",
                component: () => import("@/views/product/attr"),
                meta: {
                    title: "平台属性管理",
                }
            },
            {
                path: "/product/sku",
                name: "Sku",
                component: () => import("@/views/product/sku"),
                meta: {
                    title: "SKU管理",
                }
            },
            {
                path: "/product/spu",
                name: "Spu",
                component: () => import("@/views/product/spu"),
                meta: {
                    title: "SPU管理",
                }
            },
        ]

    },
]
/* 404 */
export const anyRoute = [
    { path: '*', redirect: '/404', hidden: true }
]